package com.example.library.dao;

import com.example.library.bean.model.BorrowOrder;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface BorrowOrderRepository extends JpaRepository<BorrowOrder,Long> {

    BorrowOrder findByBook_BookIdAndUser_UserIdAndStatus(long bookId,long userId,int status);

    long countAllByBook_BookIdAndUser_UserIdAndStatus(long bookId,long userId,int status);

    List<BorrowOrder> findAllByUser_UserIdAndStatus(long userId,int status);
}
